var Swiper = require("swiper");
require("swiper/dist/css/swiper.min.css");
var Lun= React.createClass({
	render : function(){
		return (<a href={this.props.data.data} className="swiper-slide">
			<img id="hong_banera" src={this.props.data._mid}/>
		</a>)
	}
})

export default React.createClass({
	getDefaultProps:function(){
		return {
			className : "swiper-container3"
		}
	},
	swiper : null,
	componentDidMount : function(){
        var that = this;
        this.swiper = new Swiper( "."+that.props.className, {
            autoplay : 4000,
            pagination : ".swiper-pagination"
            
        });
    },
    componentDidUpdate(){
         this.swiper.update();
    },
	render : function(){
	var that = this
		setInterval(function(){
 		//console.log(that.props.data)
 	},1000)
		
   		var SlideList = this.props.data.map(function(slide , index){
            return <Lun key={index} data={slide} />
       });
		var className = this.props.className == "swiper-container3" ? "swiper-container3" : this.props.className;
		return (  
					<div className = {className}>
					<div className="swiper-wrapper">
					  {SlideList}
					</div> 
						<div className="swiper-pagination"></div>
					</div> 
		)
	}
})



 
